package top.ffhome.system.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import top.ffhome.common.core.mybatisplus.service.impl.BaseServiceImpl;
import top.ffhome.system.domain.SysNotice;
import top.ffhome.system.mapper.SysNoticeMapper;
import top.ffhome.system.service.ISysNoticeService;

/**
 * 公告 服务层实现
 *
 * @author ruoyi
 */
@Service
public class SysNoticeServiceImpl extends BaseServiceImpl<SysNoticeMapper, SysNotice> implements ISysNoticeService {
    @Override
    protected QueryWrapper<SysNotice> generateWrapper(SysNotice query) {
        return new QueryWrapper<SysNotice>()
                .like(StrUtil.isNotBlank(query.getNoticeTitle()), "notice_title", query.getNoticeTitle())
                .like(StrUtil.isNotBlank(query.getCreateBy()), "create_by", query.getCreateBy())
                .eq(StrUtil.isNotBlank(query.getNoticeType()), "notice_type", query.getNoticeType());
    }
}
